import { VxeFormItemProps, VxeGridPropTypes } from '@gui-pkg/antdcomponents';
import { h } from 'vue';
import { Tag } from 'ant-design-vue';

export const columns: VxeGridPropTypes.Columns = [
  {
    title: '测站名称',
    field: 'stnm',
    align: 'center',
    fixed: 'left',
    treeNode: true,
  },
  {
    title: '时间',
    field: 'tm',
    align: 'center',
  },
  {
    title: '分钟累计降雨量(mm)',
    field: 'pm',
    align: 'center',
  },
  {
    title: '小时累计降雨量(mm)',
    field: 'ph',
    align: 'center',
  },
  {
    title: '日累计降雨量(mm)',
    field: 'pd',
    align: 'center',
  },
  {
    title: '镇',
    field: 'town',
    align: 'center',
  },
  {
    title: '责任人',
    field: 'contacts',
    align: 'center',
  },
  {
    title: '联系方式',
    field: 'contactsPhone',
    align: 'center',
  },
  {
    title: '管理单位',
    field: 'contactsPosition',
    align: 'center',
  },
  {
    width: 120,
    title: '操作',
    align: 'center',
    slots: { default: 'action' },
    fixed: 'right',
  },
];

export const searchFormSchema: VxeFormItemProps[] = [
  {
    field: 'menuName',
    title: '测站名称',
    itemRender: {
      name: 'AInput',
    },
    span: 6,
  },
  {
    field: 'status',
    title: '预警等级',
    itemRender: {
      name: 'ASelect',
      props: {
        options: [
          { label: 'I级', value: '1' },
          { label: 'Ⅱ级', value: '2' },
          { label: 'Ⅲ级', value: '3' },
          { label: 'IV级', value: '4' },
        ],
      },
    },
    span: 6,
  },
  {
    span: 12,
    align: 'right',
    className: '!pr-0',
    itemRender: {
      name: 'AButtonGroup',
      children: [
        {
          props: { type: 'primary', content: '查询', htmlType: 'submit' },
          attrs: { class: 'mr-2' },
        },
        { props: { type: 'default', htmlType: 'reset', content: '重置' } },
      ],
    },
  },
];
